<template>
	<view>
		<Nav leftTitle="返回" @leftclick='leftclick' title="购物车"  :rightslot=false namecar="arrow-left" />
		<view class="car">
			<checkbox-group class="check">
				<label class="checkitem">
					<checkbox value="cb" checked="true" color="#fae356" >
						<view class="checkcontent">
							<view class="imgclass">
								<image src="/static/recommend2.jpg" mode="aspectFill"></image>
							</view>
							<view class="info">
								<view class="name">fgfgdfgd二等功梵蒂冈地方大概豆腐干二等功梵蒂冈地方大概豆腐干二等功梵蒂冈地方大概豆腐干二等功梵蒂二等功梵蒂冈地方大概豆腐干二等功梵蒂冈地方大概豆腐干二等功梵蒂冈地方大概豆腐干二等功梵蒂冈地方大概豆腐干冈地方大概豆腐干</view>
								<view class="title">33</view>
								<view class="price">￥219.8</view>
							</view>
							<view class="right">
								<u-icon name="edit-pen" class="icon"  size="25"></u-icon>
								<text>1x2</text>
							</view>
						</view>
					</checkbox>
				</label>
			</checkbox-group>
			<view class="bottm">
				<view class="checkbottm">
					<image src="../../static/Snipaste_2022-08-12_17-13-09.png" mode="aspectFill"></image> 全选
				</view>
				<view class="price">
					共计￥{{}}
				</view>
				<view class="confirm">
					立即结算
				</view>
			</view>
		</view>
		
		
		
		
		
		<u-modal showCancelButton :show="showmodal" @confirm="confirm"  @cancel='cancel' title="需要用户登录"
		 content="此页面需要用户登录,否则无法访问" ref="uModal" :asyncClose="true"></u-modal>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				showmodal:false,
				checkboxValue1:[],
					// 基本案列数据
					checkboxList1: [
						{
							name: '苹果',
							disabled: false
						},
						{
							name: '香蕉',
							disabled: false
						},
						{
							name: '橙子',
							disabled: false
						}
					]
			};
		},
		methods:{
			//是否登录的弹框中确认按钮
			confirm(){
				this.showmodal = false
				uni.navigateTo({
					url:'/pages/user/user'
				})
			},
			//是否登录的弹框中取消按钮
			cancel(){
				this.showmodal = false
				uni.navigateBack(1)
			},
			//标题栏中返回按钮
			leftclick(){
				uni.navigateBack(1)
			},
			//购物车切换触发
			checkboxChange(n) {
			            console.log('change', n);
			        }
		},
		onLoad() {
			let token = uni.getStorageSync('token')
			if(token)return
			this.showmodal = true
		}
	}
</script>

<style lang="scss">
.car{
	margin: 100rpx 30rpx 50rpx;
	.check{
		width: 100%;
		display: flex;
		flex-direction: column;
		checkbox{
			width: 100% !important;
			::v-deep .uni-checkbox-wrapper{
				width: 100%;
			}
		}
		.checkitem{
			margin: 30rpx 0rpx;
			.checkcontent{
				width: 100%;
				display: flex;
				justify-content: space-between;
				align-items: center;
				.info{
					flex: 1;
					display: flex;
					flex-direction: column;
					justify-content: space-between;
					height: 200rpx;
					padding-left: 20rpx;
					padding-right: 20rpx;
					.name,.title{
						box-sizing: border-box;
						height: 80rpx;		
						colof: #999;
						max-height: 130upx;
						overflow: hidden;
						word-break: break-all;  /* break-all(允许在单词内换行。) */
						text-overflow: ellipsis;  /* 超出部分省略号 */
						display: -webkit-box; /** 对象作为伸缩盒子模型显示 **/
						-webkit-box-orient: vertical; /** 设置或检索伸缩盒对象的子元素的排列方式 **/
						-webkit-line-clamp: 2; /** 显示的行数 **/
						font-size: 16px;
					}
					.title{
						padding-top: 15rpx;
						font-size: 14px;
					}
				}
			}
			.imgclass{
				width: 200rpx;
				height: 200rpx;
				background-color: pink;
				margin-left: 20rpx;
				image{
					width: 100%;
					height: 100%;
				}
			}
			.right{
				
				.icon{
					width: 70rpx;
					height: 70rpx;
					background-color: #e6e6e6;
					border-radius: 50%;
					margin: auto;
					display: flex;
					justify-content: center;
					align-items: center;
				}
			}
		}
	}
}
.bottm{
	border-top: 1px solid #eee;
	position: absolute;
	bottom: 0px;
	right: 0px;
	left: 0px;
	height: 100rpx;
	// background-color: pink;
	display: flex;
	align-items: center;
	.checkbottm{
		margin-left: 30rpx;
		
		width: 150rpx;
		image{
			width: 40rpx;
			height: 40rpx;
			vertical-align: bottom;
			margin-right: 10rpx;
		}
	}
	.price{
		flex: 1;
	}
	.confirm{
		width: 160rpx;
		height: 100%;
		background-color: orange;
		line-height: 100rpx;
		text-align: center;
	}
}

</style>
